//
// Alertbar
// ==============================


// base

.Alertbar {
	.translateZ(0); // stop re-paint when introduced into the DOM
	.transition( background-color 160ms ); // animate variant if state changed while visible
	color: white;
	font-size: @font-size-sm;
	left: 0;
	line-height: 1.1;
	padding: @gutter-sm;
	text-align: center;
	top: 0;
	width: 100%;
	z-index: @zindex-alertbar;
}


// overlay translucent for pulse

.Alertbar--pulse::after {
	.animation( pulse 2s linear infinite );
	.fill-space();
	background-color: black;
	content: "";
	opacity: 0;
	z-index: 1;
}


// sit the text above the pulsing background

.Alertbar__inner {
	position: relative;
	z-index: 2;
}


// variants

.Alertbar--danger   { background-color: @app-danger; }
.Alertbar--default  { background-color: @gray-light; }
.Alertbar--info     { background-color: @app-info; }
.Alertbar--primary  { background-color: @app-primary; }
.Alertbar--success  { background-color: @app-success; }
.Alertbar--warning  { background-color: @app-warning; }




// Animation
// ------------------------------


// prepare for animation

.Alertbar--animated {
	margin: 0;
	position: absolute;
}


// apply animation

.Alertbar-enter {
	.animation( alertbarEnter 240ms @view-transition-timing-function );
}
.Alertbar-leave {
	.animation( alertbarLeave 240ms @view-transition-timing-function );
}

// slide up

@-webkit-keyframes alertbarEnter {
	from {-webkit-transform: translate3d(0, -100%, 0); opacity: .5; }
	to { -webkit-transform: none; opacity: 1; }
}
@keyframes alertbarEnter {
	from {transform: translate3d(0, -100%, 0); opacity: .5; }
	to { transform: none; opacity: 1; }
}

// slide down

@-webkit-keyframes alertbarLeave {
	from { -webkit-transform: none; opacity: 1; }
	to { -webkit-transform: translate3d(0, -100%, 0); opacity: .5; }
}
@keyframes alertbarLeave {
	from { transform: none; opacity: 1; }
	to {transform: translate3d(0, -100%, 0); opacity: .5; }
}
